<script lang="ts" setup>
	import { ref } from 'vue'
	import order_listVue from './components/order_list.vue'
	const tabIndex = ref(0)
	const tabData = ref([
		{ label: '问诊', rendered: true },
		{ label: '极速', rendered: false },
		{ label: '药品', rendered: false },
	])

	const tabChange = (index) => {
		tabIndex.value = index
		//每个标签只会被初始化一次
		tabData.value[index].rendered = true
	}
</script>

<template>
	<!-- 上方部分 -->
	<custom-tab :data="tabData" @change="tabChange"></custom-tab>
	<!-- 订单列表 -->
	<view v-for="(item, index) in tabData" :key="index" v-show="tabIndex === index" class="">
		<order_listVue v-if="item.rendered"></order_listVue>
	</view>
</template>

<style lang="scss"></style>
